1. Field of the Invention
The present invention relates to an image processing apparatus and method for encoding image data.
2. Related Background Art
In conventional compression encoding of multi-value data, a block consisting of a plurality of pixels is extracted or formed from image data, and compression encoding is performed in units of blocks. In the JPEG, MPEG, and H.261 schemes as the international standard schemes for image encoding, a block having a predetermined block size of 8 (horizontal).times.8 (vertical) pixels is used.
This block data is processed by DCT (Discrete Cosine Transform) to obtain a transform coefficient. This transform coefficient is quantized, and the quantized data is encoded to obtain a variable-length compressed code, e.g., a Huffman code.
This image compression encoding can provide an enhanced compression effect because most of the multi-value natural images have very large redundant portions. The redundant portions include a flat portion obtained when a plurality of adjacent pixel values have close values, and a monotonous gradient portion obtained when most of small areas in an image have monotonous luminance gradients. The average information volume obtained upon DCT operations is decreased because the 0th and 1st DCT bases match the form of a redundant portion, thereby exhibiting a compression effect.
If the formed block is flat or has a monotonous gradient, the compression factor can be increased. Otherwise, the word length increases upon DCT transform, thereby decreasing the compression factor.
As described above, compression coding is conventionally performed in units of blocks each having a size of 8.times.8 pixels. For this reason, when a block subjected to compression encoding has a large number of redundant portions, the compression factor can be increased. However, when the number of redundant portions is small, the compression factor is decreased. This problem is not limited to encoding using DCT, but also applies to other block encoding schemes such as encoding using a difference value.